module.exports = function($scope, $stateParams, $state, $modal, $modalInstance,FileUploader,$resource,toaster,items, type){  
    console.log(items)
    console.log(type);
    $scope.type = type;
    $resource('/api/as/ggc/review/getState', {}, {}).save({project_code:items.project_code}, function(res){			 
        if(res.errcode === 0 || res.errcode === 10003){
					console.log(res);
          console.log('上面是企业项目列表返回值') 
          $scope.a = res.data;
              $scope.btn9='btn  btn-default'
              $scope.btn8='btn  btn-default'
              $scope.btn7='btn  btn-default'
              $scope.btn6='btn  btn-default'
              $scope.btn5='btn  btn-default'
              $scope.btn4='btn  btn-default'
              $scope.btn3='btn  btn-default'
              $scope.btn2='btn  btn-default'
              $scope.btn1='btn  btn-default' 
              if (type == '1' && $scope.a.project_state == '7' && $scope.a.leaders_state == '1'){
                $scope.btn9='btn  btn-success'
              }
              if(type == '1' && $scope.a.leader_state == '1'){
                $scope.btn8='btn   btn-success' 
            } 
              if($scope.a.director_agree=='2'){
                  $scope.btn7='btn  btn-success'
                  $scope.btn6='btn  btn-success'
                  $scope.btn5='btn  btn-success'
                  $scope.btn4='btn  btn-success'
                  $scope.btn3='btn  btn-success'
                  $scope.btn2='btn  btn-success'
                  $scope.btn1='btn  btn-success'                        
              }else if($scope.a.expert_state == '1'){
                  $scope.btn6='btn   btn-success'
                  $scope.btn5='btn   btn-success'
                  $scope.btn4='btn   btn-success'
                  $scope.btn3='btn   btn-success'
                  $scope.btn2='btn   btn-success'
                  $scope.btn1='btn   btn-success' 
              }else if($scope.a.project_state =='5'){
                  $scope.btn5='btn   btn-success'
                  $scope.btn4='btn   btn-success'
                  $scope.btn3='btn   btn-success'
                  $scope.btn2='btn   btn-success'
                  $scope.btn1='btn   btn-success' 
              }else if($scope.a.recommend_city == '1'){
                  $scope.btn4='btn   btn-success'
                  $scope.btn3='btn   btn-success'
                  $scope.btn2='btn   btn-success'
                  $scope.btn1='btn   btn-success' 
              }else if($scope.a.project_state =='3'){                       
                  $scope.btn3='btn   btn-success'
                  $scope.btn2='btn   btn-success'
                  $scope.btn1='btn   btn-success' 
              }else if($scope.a.recommend_district == '1'){
                  $scope.btn2='btn   btn-success'
                  $scope.btn1='btn   btn-success' 
              }else if($scope.a.project_state =='1'){
                  $scope.btn1='btn   btn-success' 
              } else if(type == '1' && $scope.a.project_state =='6' && $scope.a.leader_state == '1'){
                  $scope.btn8='btn   btn-success' 
              } else if(type == '1' && $scope.a.project_state =='7' && $scope.a.leaders_state == '1'){
                  $scope.btn9='btn   btn-success' 
              }  
              if ($scope.a.planning_state == '1') {
                  $scope.btn5 = 'btn   btn-success';
              }
          }else{
              alert(res.errmsg);
          }
      });

$scope.cancel = function(){
    $modalInstance.close();
}
        
};